package com.usian.quartz;

import com.usian.service.UserService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;

public class MyJob implements Job {

    private final static Logger logger = LoggerFactory.getLogger(MyJob.class);

    @Autowired
    private UserService userService;

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {

        //1:job 做什么事情
        logger.info("quartz定时任务要执行的内容"+new Date());
        userService.quartzTest();

    }
}
